using System;
using System.Data;
using System.Collections;
using APP.QUANLY.Common;

namespace RMAS.DAL
{
    /// <summary>
    /// Summary description for WAREHOUSE_PRODUCT.
    /// </summary>
    public class WAREHOUSE_PRODUCT
    {
              private string _WHID;
      private string _PrID;
      private string _PrName;
      private Int32 _FirstBalance;
      private Int32 _LastBalance;
      private Int32 _addUp;
      private Int32 _addDown;
      private Int16 _Month;
      private Int32 _Year;
      private string _Log;
      private bool _IsLock;
      private string _IDPOS;
        private bool isExisting;
        #region Properties
        public bool IsExisting
        {
              get{return isExisting;}
              set{isExisting = value;}
        }
	      public bool IsSetWHID; 
      public bool IsWHIDNullable   
      { 
	 get { return false;  } 
      }
      public string WHID
      {
         get { return _WHID; }
         set 
	    { 
 		 _WHID = value;
		IsSetWHID = true;
 	    }
      }
      public bool IsSetPrID; 
      public bool IsPrIDNullable   
      { 
	 get { return false;  } 
      }
      public string PrID
      {
         get { return _PrID; }
         set 
	    { 
 		 _PrID = value;
		IsSetPrID = true;
 	    }
      }
    public bool IsSetPrName; 
    public bool IsPrNameNullable   
    { 
		get { return false;  } 
    }
    public string PrName
    {
        get{ return _PrName;  }
        set
		{
			_PrName = value;
			IsSetPrName = true;
		}
    }
    public bool IsSetFirstBalance; 
    public bool IsFirstBalanceNullable   
    { 
		get { return false;  } 
    }
    public Int32 FirstBalance
    {
        get{ return _FirstBalance;  }
        set
		{
			_FirstBalance = value;
			IsSetFirstBalance = true;
		}
    }
    public bool IsSetLastBalance; 
    public bool IsLastBalanceNullable   
    { 
		get { return false;  } 
    }
    public Int32 LastBalance
    {
        get{ return _LastBalance;  }
        set
		{
			_LastBalance = value;
			IsSetLastBalance = true;
		}
    }
    public bool IsSetAddUp; 
    public bool IsAddUpNullable   
    { 
		get { return false;  } 
    }
    public Int32 addUp
    {
        get{ return _addUp;  }
        set
		{
			_addUp = value;
			IsSetAddUp = true;
		}
    }
    public bool IsSetAddDown; 
    public bool IsAddDownNullable   
    { 
		get { return false;  } 
    }
    public Int32 addDown
    {
        get{ return _addDown;  }
        set
		{
			_addDown = value;
			IsSetAddDown = true;
		}
    }
    public bool IsSetMonth; 
    public bool IsMonthNullable   
    { 
		get { return false;  } 
    }
    public Int16 Month
    {
        get{ return _Month;  }
        set
		{
			_Month = value;
			IsSetMonth = true;
		}
    }
    public bool IsSetYear; 
    public bool IsYearNullable   
    { 
		get { return false;  } 
    }
    public Int32 Year
    {
        get{ return _Year;  }
        set
		{
			_Year = value;
			IsSetYear = true;
		}
    }
    public bool IsSetLog; 
    public bool IsLogNullable   
    { 
		get { return false;  } 
    }
    public string Log
    {
        get{ return _Log;  }
        set
		{
			_Log = value;
			IsSetLog = true;
		}
    }
    public bool IsSetIsLock; 
    public bool IsIsLockNullable   
    { 
		get { return false;  } 
    }
    public bool IsLock
    {
        get{ return _IsLock;  }
        set
		{
			_IsLock = value;
			IsSetIsLock = true;
		}
    }
    public bool IsSetIDPOS; 
    public bool IsIDPOSNullable   
    { 
		get { return false;  } 
    }
    public string IDPOS
    {
        get{ return _IDPOS;  }
        set
		{
			_IDPOS = value;
			IsSetIDPOS = true;
		}
    }

        #endregion

        #region Constructors
        public WAREHOUSE_PRODUCT()
        {
            Reset();
        }
        public WAREHOUSE_PRODUCT(WAREHOUSE_PRODUCT obj)
        {
            	this._WHID = obj.WHID;
	this._PrID = obj.PrID;
	this._PrName = obj.PrName;
	this._FirstBalance = obj.FirstBalance;
	this._LastBalance = obj.LastBalance;
	this._addUp = obj.addUp;
	this._addDown = obj.addDown;
	this._Month = obj.Month;
	this._Year = obj.Year;
	this._Log = obj.Log;
	this._IsLock = obj.IsLock;
	this._IDPOS = obj.IDPOS;
        }
        #endregion

        public void Reset()
        {
                     _WHID = EmptyValues.v_string;
         _PrID = EmptyValues.v_string;
         _PrName = EmptyValues.v_string;
         _FirstBalance = EmptyValues.v_Int32;
         _LastBalance = EmptyValues.v_Int32;
         _addUp = EmptyValues.v_Int32;
         _addDown = EmptyValues.v_Int32;
         _Month = EmptyValues.v_Int16;
         _Year = EmptyValues.v_Int32;
         _Log = EmptyValues.v_string;
         _IsLock = EmptyValues.v_bool;
         _IDPOS = EmptyValues.v_string;
        }

         
        #region Hidden

        /*
        private void readProperties(IDataReader reader)
        {
            try
            {
                                if(!(reader["WHID"] is DBNull))
		{
			obj.WHID = (string)reader["WHID"];
		}
                if(!(reader["PrID"] is DBNull))
		{
			obj.PrID = (string)reader["PrID"];
		}
                if(!(reader["PrName"] is DBNull))
		{
			obj.PrName = (string)reader["PrName"];
		}
                if(!(reader["FirstBalance"] is DBNull))
		{
			obj.FirstBalance = (Int32)reader["FirstBalance"];
		}
                if(!(reader["LastBalance"] is DBNull))
		{
			obj.LastBalance = (Int32)reader["LastBalance"];
		}
                if(!(reader["addUp"] is DBNull))
		{
			obj.AddUp = (Int32)reader["addUp"];
		}
                if(!(reader["addDown"] is DBNull))
		{
			obj.AddDown = (Int32)reader["addDown"];
		}
                if(!(reader["Month"] is DBNull))
		{
			obj.Month = (Int16)reader["Month"];
		}
                if(!(reader["Year"] is DBNull))
		{
			obj.Year = (Int32)reader["Year"];
		}
                if(!(reader["Log"] is DBNull))
		{
			obj.Log = (string)reader["Log"];
		}
                if(!(reader["IsLock"] is DBNull))
		{
			obj.IsLock = (bool)reader["IsLock"];
		}
                if(!(reader["IDPOS"] is DBNull))
		{
			obj.IDPOS = (string)reader["IDPOS"];
		}
//            _WHID = (reader["WHID"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["WHID"];
//            _PrID = (reader["PrID"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["PrID"];
//            _PrName = (reader["PrName"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["PrName"];
//            _FirstBalance = (reader["FirstBalance"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["FirstBalance"];
//            _LastBalance = (reader["LastBalance"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["LastBalance"];
//            _addUp = (reader["addUp"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["addUp"];
//            _addDown = (reader["addDown"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["addDown"];
//            _Month = (reader["Month"] is DBNull)?DalTools.EmptyValues.v_Int16:(Int16)reader["Month"];
//            _Year = (reader["Year"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["Year"];
//            _Log = (reader["Log"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Log"];
//            _IsLock = (reader["IsLock"] is DBNull)?DalTools.EmptyValues.v_bool:(bool)reader["IsLock"];
//            _IDPOS = (reader["IDPOS"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["IDPOS"];
            }
            catch (Exception ex)
            {
                throw new DalException("Failed to read properties from DataReader.", ex);
            }
        } 
        */

        #endregion


        public void Fill(string WHID, string PrID, string PrName, Int32 FirstBalance, Int32 LastBalance, Int32 addUp, Int32 addDown, Int16 Month, Int32 Year, string Log, bool IsLock, string IDPOS)
        {
                     this._WHID = WHID;
         this._PrID = PrID;
         this._PrName = PrName;
         this._FirstBalance = FirstBalance;
         this._LastBalance = LastBalance;
         this._addUp = addUp;
         this._addDown = addDown;
         this._Month = Month;
         this._Year = Year;
         this._Log = Log;
         this._IsLock = IsLock;
         this._IDPOS = IDPOS;
        }
    }
}